{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "7e1a4437",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import BMap\n",
    "from pyecharts.faker import Faker\n",
    "\n",
    "c = (\n",
    "    BMap()\n",
    "    .add_schema(baidu_ak=\"FAKE_AK\", center=[120.13066322374, 30.240018034923])\n",
    "    .add(\n",
    "        \"bmap\",\n",
    "        [list(z) for z in zip(Faker.provinces, Faker.values())],\n",
    "        type_=\"heatmap\",\n",
    "        label_opts=opts.LabelOpts(formatter=\"{b}\"),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"BMap-热力图\"), visualmap_opts=opts.VisualMapOpts()\n",
    "    )\n",
    "#     .render_notebook()\n",
    "    .render(\"bmap_heatmap.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4e3ce50a",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "python",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
